﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StuertzDatenbank
{
    public partial class Seriehinzufügen : Form
    {
        private Sprachfile sprachfile;
        private DBF dbf;
        private Profil profil;
        public Seriehinzufügen(Profil Profile )
        {
            sprachfile = new Sprachfile();
            dbf = new DBF();
            InitializeComponent();
            InitializeComponentChange();
            profil = Profile;
            Refresh();
        }

        private void InitializeComponentChange()
        {
            this.Text = sprachfile.Seriehinzufügen;
            this.Seriehinzufügenknopf.Text = sprachfile.Seriehinzufügen;
            this.Serie.Text = sprachfile.Serie;

            this.Serienbox.Text = "";
        }

        private void Seriehinzufügenknopf_Click(object sender, EventArgs e)
        {
            Serie s = new StuertzDatenbank.Serie(-1);
            s.setSerie(this.Serienbox.Text);
            s.setID(dbf.createSerie(s));
            this.profil.getSerie().Add(s);
            this.Visible = false;
            this.Dispose();
        }

       
        
    }
}
